// TestPGSQL.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <boost/regex.hpp>
#include <iostream>
#include <string>
#include<vector>
#include "libpq-fe.h"
#include <time.h> 
#include <ctime>
#include "Conn.h"
void testfuntion()
{
	map_result res; 
	Conn *postgres =new Conn("host=127.0.0.1 dbname=test user=postgres password=123456 port=5432 connect_timeout=5"); 

	postgres->fetch("SELECT role_ins('ad','gh')",res); 
	map_result::iterator it = res.begin(); 
	for( ; it!=res.end(); ++it ) 
	{ 
		std::cout <<"ROW:"<< it->first << std::endl; 
		map<string,string>::iterator itField = it->second.begin(); 
		for( ; itField!=it->second.end(); ++itField ) 
		{ 
			std::cout <<"Field:"<< itField->first <<" Value:"<< itField->second << std::endl; 
		} 
	}
	delete postgres;

};

int _tmain(int argc, _TCHAR* argv[])
{
	testfuntion();
	return 0;
}

